package com.zxl.yjb.adapter;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.zxl.yjb.GlideApp;
import com.zxl.yjb.R;
import com.zxl.yjb.bean.MenuClassifyBean;

import java.util.List;

public class MenuItemAdapter extends BaseQuickAdapter<MenuClassifyBean,BaseViewHolder> {

    List<MenuClassifyBean> dataList;

    public MenuItemAdapter(int layoutResId, @Nullable List<MenuClassifyBean> dataList) {
        super(layoutResId, dataList);
        this.dataList = dataList;
    }


    @Override
    protected void convert(BaseViewHolder helper, MenuClassifyBean item) {
        helper.setText(R.id.tv_menu_text,item.getName());
        GlideApp.with(mContext).load(item.getIcon()).into((ImageView) helper.getView(R.id.iv_menu_icon));
    }
}
